Conversation
|
I'm not sure what problem you're referring to. Can you provide some examples? I'm trying to run xdgmenumaker with different locales with and without your patch and I see no differences. |
|
If @City-busz could provide an automatic test along the commit that would help… |
|
E.g. GNOME Clocks has the following name in Hungarian: Without this patch, when I run xdgmenumaker with
So the menu item for "Órák" is at the end of the list, which is not correct according to the Hungarian alphabet. With this patch, I get the proper order:
|
|
I tried that here, but Órák ends up at the end even with your patch. There is no difference with or without the patch. |
|
I made it work, but one thing is missing. What I did: First a simple test file import locale
from os import getenv
data = [
"Időjárás",
"Lemezek"
"Számológép",
"Térképek",
"Órák",
]
locale.setlocale(locale.LC_ALL, getenv('LANG', ''))
print("simple sorted", sorted(data))
print("locale sorted", sorted(data, key=lambda entry: locale.strxfrm(entry)))$ env LANG=C python locale-test.py
simple sorted ['Időjárás', 'LemezekSzámológép', 'Térképek', 'Órák']
locale sorted ['Időjárás', 'LemezekSzámológép', 'Térképek', 'Órák']I installed the Hungarian locale, but I also get the correct result with my French locale ( $ echo $LANG
fr_FR.utf8
$ python locale-test.py
simple sorted ['Időjárás', 'LemezekSzámológép', 'Térképek', 'Órák']
locale sorted ['Időjárás', 'LemezekSzámológép', 'Órák', 'Térképek']$ env LANG=hu_HU.UTF-8 python locale-test.py
simple sorted ['Időjárás', 'LemezekSzámológép', 'Térképek', 'Órák']
locale sorted ['Időjárás', 'LemezekSzámológép', 'Órák', 'Térképek']I also got this in Greek Gapan, so you can probably test invoking python directly: $ env LANG=el_GR.UTF-8 python locale-test.py
simple sorted ['Időjárás', 'LemezekSzámológép', 'Térképek', 'Órák']
locale sorted ['Időjárás', 'LemezekSzámológép', 'Órák', 'Térképek']The important thing is to do I just discovered that last week for another python project. Using For this particular thing (only sorting) then https://docs.python.org/3/library/locale.html#locale.setlocale |
|
So please @City-busz add |
This fixes the problem that entries started with non-English characters are placed at the end of the list.
236648c to
7328143
Compare
|
Okay, I added |
This fixes the problem that entries started with non-English characters are placed at the end of the list.